package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.FilmScheduleSaleChannelType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-03-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("film_schedule_sale_channels")
@ApiModel(value="FilmScheduleSaleChannelsEntity对象", description="")
public class FilmScheduleSaleChannelEntity implements Serializable {

    @ApiModelProperty(value = "售票渠道ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "类型：0表示微信，1表示抖音，2表示支付宝")
    private FilmScheduleSaleChannelType type;

    @ApiModelProperty(value = "影片排期ID")
    private Long filmScheduleId;
    
    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    public FilmScheduleSaleChannelEntity() {
    }
    
    public FilmScheduleSaleChannelEntity(Short type, Long filmScheduleId) {
        this.type = FilmScheduleSaleChannelType.Companion.valueOf(type);
        this.filmScheduleId = filmScheduleId;
    }
}
